<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  

  
  <title>Hexo配合GitHub搭建个人博客 | 小豆子的Blog</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="description" content="Hexo配合GitHub搭建个人博客 安装各类软件  Git emmmm  这个自己去百度去   Node.js 这个也百度去   Hexo sudo npm install hexo-cli -g     初始化     找个自己喜欢的目录，创建一个喜欢的目录名 eg: mkdir Blog   进入目录并初始化 cd Blog hexo init npm install     运行  hex">
<meta property="og:type" content="article">
<meta property="og:title" content="Hexo配合GitHub搭建个人博客">
<meta property="og:url" content="http://yoursite.com/2020/05/29/Hexo%E9%85%8D%E5%90%88GitHub%E6%90%AD%E5%BB%BA%E4%B8%AA%E4%BA%BA%E5%8D%9A%E5%AE%A2/index.html">
<meta property="og:site_name" content="小豆子的Blog">
<meta property="og:description" content="Hexo配合GitHub搭建个人博客 安装各类软件  Git emmmm  这个自己去百度去   Node.js 这个也百度去   Hexo sudo npm install hexo-cli -g     初始化     找个自己喜欢的目录，创建一个喜欢的目录名 eg: mkdir Blog   进入目录并初始化 cd Blog hexo init npm install     运行  hex">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="http://yoursite.com/2020/05/29/img/20200512/828879970.png">
<meta property="article:published_time" content="2020-05-29T02:53:56.186Z">
<meta property="article:modified_time" content="2020-05-29T02:53:56.186Z">
<meta property="article:author" content="John Doe">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="http://yoursite.com/2020/05/29/img/20200512/828879970.png">
  
    <link rel="alternate" href="/atom.xml" title="小豆子的Blog" type="application/atom+xml">
  
  
    <link rel="icon" href="/favicon.png">
  
  
    <link href="//fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet" type="text/css">
  
  
<link rel="stylesheet" href="/css/style.css">

<meta name="generator" content="Hexo 4.2.0"></head>

<body>
  <div id="container">
    <div id="wrap">
      <header id="header">
  <div id="banner"></div>
  <div id="header-outer" class="outer">
    <div id="header-title" class="inner">
      <h1 id="logo-wrap">
        <a href="/" id="logo">小豆子的Blog</a>
      </h1>
      
    </div>
    <div id="header-inner" class="inner">
      <nav id="main-nav">
        <a id="main-nav-toggle" class="nav-icon"></a>
        
          <a class="main-nav-link" href="/">Home</a>
        
          <a class="main-nav-link" href="/archives">Archives</a>
        
      </nav>
      <nav id="sub-nav">
        
          <a id="nav-rss-link" class="nav-icon" href="/atom.xml" title="RSS Feed"></a>
        
        <a id="nav-search-btn" class="nav-icon" title="搜索"></a>
      </nav>
      <div id="search-form-wrap">
        <form action="//google.com/search" method="get" accept-charset="UTF-8" class="search-form"><input type="search" name="q" class="search-form-input" placeholder="Search"><button type="submit" class="search-form-submit">&#xF002;</button><input type="hidden" name="sitesearch" value="http://yoursite.com"></form>
      </div>
    </div>
  </div>
</header>
      <div class="outer">
        <section id="main"><article id="post-Hexo配合GitHub搭建个人博客" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/2020/05/29/Hexo%E9%85%8D%E5%90%88GitHub%E6%90%AD%E5%BB%BA%E4%B8%AA%E4%BA%BA%E5%8D%9A%E5%AE%A2/" class="article-date">
  <time datetime="2020-05-29T02:53:56.186Z" itemprop="datePublished">2020-05-29</time>
</a>
    
  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 class="article-title" itemprop="name">
      Hexo配合GitHub搭建个人博客
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <h3 id="Hexo配合GitHub搭建个人博客"><a href="#Hexo配合GitHub搭建个人博客" class="headerlink" title="Hexo配合GitHub搭建个人博客"></a>Hexo配合GitHub搭建个人博客</h3><ol>
<li><p>安装各类软件</p>
<ul>
<li>Git<ul>
<li>emmmm  这个自己去百度去</li>
</ul>
</li>
<li>Node.js<ul>
<li>这个也百度去</li>
</ul>
</li>
<li>Hexo<ul>
<li><code>sudo npm install hexo-cli -g</code></li>
</ul>
</li>
</ul>
</li>
<li><p>初始化   </p>
<ul>
<li>找个自己喜欢的目录，创建一个喜欢的目录名<ul>
<li>eg: <code>mkdir Blog</code></li>
</ul>
</li>
<li>进入目录并初始化<ul>
<li><code>cd Blog</code></li>
<li><code>hexo init</code></li>
<li><code>npm install</code></li>
</ul>
</li>
</ul>
</li>
<li><p>运行</p>
<ul>
<li><code>hexo server</code></li>
</ul>
</li>
<li><p>进行部署</p>
<ul>
<li>进入GitHub创建一个公共仓库，取名为<code>&lt;GitHub账户名&gt;.github.io</code></li>
<li>打开<code>Blog</code>目录下的<code>_config.yml</code>，修改一下最后几行</li>
<li>eg：     <figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">deploy:</span><br><span class="line">type: git</span><br><span class="line">repo: 自己的仓库地址</span><br><span class="line">branch: master</span><br></pre></td></tr></table></figure></li>
</ul>
</li>
<li><p>创建文章</p>
<ul>
<li>在<code>Blog/source/_posts/</code>目录下开始写吧</li>
<li>想要插入图片？ 没问题<ul>
<li>当前目录下创建一个文件夹，放置图片，他不香吗？</li>
<li>eg:     <figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">.</span><br><span class="line">├── img</span><br><span class="line">│   └── 20200512</span><br><span class="line">│       └── 828879970.png</span><br><span class="line">└── _posts</span><br><span class="line">    └── Hexo配合GitHub搭建个人博客.md</span><br></pre></td></tr></table></figure></li>
</ul>
</li>
<li>图片演示<br>  <img src="../img/20200512/828879970.png" alt="alt"></li>
</ul>
</li>
<li><p>上传</p>
<ul>
<li><code>hexo clean</code></li>
<li><code>hexo generate</code> 或者 <code>hexo g</code></li>
<li><code>hexo deploy</code> 或者 <code>hexo d</code></li>
</ul>
</li>
<li><p>关于换主题，emmm，我觉得自带的很好看哇，就不换了。</p>
</li>
</ol>

      
    </div>
    <footer class="article-footer">
      <a data-url="http://yoursite.com/2020/05/29/Hexo%E9%85%8D%E5%90%88GitHub%E6%90%AD%E5%BB%BA%E4%B8%AA%E4%BA%BA%E5%8D%9A%E5%AE%A2/" data-id="ckarn4zr300013cbie31tdv6y" class="article-share-link">Share</a>
      
      
    </footer>
  </div>
  
    
<nav id="article-nav">
  
    <a href="/2020/05/29/%E5%A4%B1%E5%A3%B0%E7%97%9B%E5%93%AD%E4%B9%8B%E5%B8%B8%E7%94%A8Linux%E5%91%BD%E4%BB%A4/" id="article-nav-newer" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Newer</strong>
      <div class="article-nav-title">
        
          失声痛哭之常用Linux命令
        
      </div>
    </a>
  
  
    <a href="/2020/05/29/Java/%E5%AD%A6%E4%B9%A0Java%E7%AC%AC%E4%B8%80%E8%AF%BE/" id="article-nav-older" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Older</strong>
      <div class="article-nav-title">Java/学习Java第一课</div>
    </a>
  
</nav>

  
</article>

</section>
        
          <aside id="sidebar">
  
    

  
    

  
    
  
    
  <div class="widget-wrap">
    <h3 class="widget-title">归档</h3>
    <div class="widget">
      <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/archives/2020/06/">六月 2020</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2020/05/">五月 2020</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">最新文章</h3>
    <div class="widget">
      <ul>
        
          <li>
            <a href="/2020/06/07/Python%E7%AC%AC%E4%B8%89%E6%96%B9%E5%BA%93numpy%E7%9A%84%E7%AE%80%E5%8D%95%E5%85%A5%E9%97%A8%E4%BD%BF%E7%94%A8/">Python第三方库numpy的简单入门使用</a>
          </li>
        
          <li>
            <a href="/2020/06/02/Python%E8%BF%AD%E4%BB%A3%E5%99%A8%E5%8F%8A%E7%94%9F%E6%88%90%E5%99%A8%E7%9A%84%E7%AE%80%E5%8D%95%E7%90%86%E8%A7%A3/">Python迭代器及生成器的简单理解</a>
          </li>
        
          <li>
            <a href="/2020/06/01/Python%E8%A3%85%E9%A5%B0%E5%99%A8%E7%9A%84%E7%AE%80%E5%8D%95%E7%90%86%E8%A7%A3/">Python装饰器的简单理解</a>
          </li>
        
          <li>
            <a href="/2020/06/01/Python%E9%97%AD%E5%8C%85%E7%9A%84%E7%AE%80%E8%A6%81%E4%BB%8B%E7%BB%8D/">闭包的简要介绍</a>
          </li>
        
          <li>
            <a href="/2020/05/31/Python%E8%BF%9E%E6%8E%A5C%E5%AE%9E%E7%8E%B0%E9%AB%98%E6%95%88%E7%BC%96%E7%A8%8Bdemo/">Python连接C实现高效编程demo</a>
          </li>
        
      </ul>
    </div>
  </div>

  
</aside>
        
      </div>
      <footer id="footer">
  
  <div class="outer">
    <div id="footer-info" class="inner">
      &copy; 2020 John Doe<br>
      Powered by <a href="http://hexo.io/" target="_blank">Hexo</a>
    </div>
  </div>
</footer>
    </div>
    <nav id="mobile-nav">
  
    <a href="/" class="mobile-nav-link">Home</a>
  
    <a href="/archives" class="mobile-nav-link">Archives</a>
  
</nav>
    

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>


  
<link rel="stylesheet" href="/fancybox/jquery.fancybox.css">

  
<script src="/fancybox/jquery.fancybox.pack.js"></script>




<script src="/js/script.js"></script>




  </div>
</body>
</html>